home *** CD-ROM | disk | FTP | other *** search
/ PCMania 19 / PCMania19.iso / Jogos em Flash / TABULEIRO / FLASHCHESSER.SWF / scripts / DefineButton2_21 / BUTTONCONDACTION on(release).as next >
Text File  |  2002-05-07  |  2KB  |  69 lines

  1. on(release){
  2.    if(1 < schaakstuk._currentframe && (_root.selectieStuk == 0 || _root.selectieStuk == this._name))
  3.    {
  4.       trace("if 1 passed");
  5.       if(schaakstuk._currentframe % 2 == 0 && _root.kleurBeurt % 2 == 0 || schaakstuk._currentframe % 2 != 0 && _root.kleurBeurt % 2 != 0)
  6.       {
  7.          trace("if 2 passed");
  8.          if(selectierand._alpha == 100)
  9.          {
  10.             setProperty(selectierand, _alpha, 0);
  11.             _root.selectieStuk = 0;
  12.          }
  13.          else
  14.          {
  15.             setProperty(selectierand, _alpha, 100);
  16.             _root.selectieStuk = this._name;
  17.          }
  18.       }
  19.    }
  20.    else
  21.    {
  22.       trace("else 1 passed");
  23.       if(_root.zetStuk(_root.selectieStuk,this._name) == true)
  24.       {
  25.          trace("zetstuk passed");
  26.          _root.stukVanVoor = eval("_root." + _root.selectieStuk + ".schaakstuk._currentframe");
  27.          _root.stukNaarVoor = schaakstuk._currentframe;
  28.          _root.tekst = eval("_root." + _root.selectieStuk + ".schaakstuk._currentframe");
  29.          tellTarget(schaakstuk)
  30.          {
  31.             gotoAndStop(eval("_root." + _root.selectieStuk + ".schaakstuk._currentframe"));
  32.          }
  33.          tellTarget(eval("_root." + _root.selectieStuk + ".schaakstuk"))
  34.          {
  35.             gotoAndStop(1);
  36.          }
  37.          if(_root.staIkSchaak(schaakstuk._currentframe % 2) == true)
  38.          {
  39.             trace("staat SCHAAK");
  40.             tellTarget(eval("_root." + _root.selectieStuk + ".schaakstuk"))
  41.             {
  42.                gotoAndStop(_root.stukVanVoor);
  43.             }
  44.             tellTarget(schaakstuk)
  45.             {
  46.                gotoAndStop(_root.stukNaarVoor);
  47.             }
  48.          }
  49.          else
  50.          {
  51.             tellTarget(eval("_root." + _root.selectieStuk + ".selectieRand"))
  52.             {
  53.                setProperty(selectierand, _alpha, 0);
  54.             }
  55.             _root.selectieStuk = 0;
  56.             _root.kleurBeurt = Math.round(schaakstuk._currentframe - 1);
  57.             if(_root.dekleur == "WHITE plays")
  58.             {
  59.                _root.dekleur = "BLACK plays";
  60.             }
  61.             else
  62.             {
  63.                _root.dekleur = "WHITE plays";
  64.             }
  65.          }
  66.       }
  67.    }
  68. }
  69.